package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.pojo.Order;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface OrderMapper {
    void add(Order order);

    List<Order> findByCondition(Order order);

    Map findById4Detail(Integer id);

    Integer findOrderCountByDate(String date);

    Integer findOrderCountAfterDate(String date);

    Integer findVisitsCountByDate(String date);

    Integer findVisitsCountAfterDate(String date);

    List<Map> findHotSetmeal();

    Integer findCountByDate(String currentDateStr);

    Integer findCountByDateAndVisited(String currentDateString);

    Integer findCountByDateScope(String startDateStr, String endDateStr);

    Integer findCountByDateScopeAndVisited(String startDateStr, String endDateStr);

    /* ========================================================================================================= */

    /**
     * 1.模糊查询
     *
     * @param keyword
     * @return
     */
    Page<Map> getByCondition(@Param("keyword") String keyword);

    /**
     * 2.根据条件删除已有的预约
     *
     * @param order
     */
    void deleteRecordByCondition(Order order);

    /**
     * 3.后台编辑预约设置
     *
     * @param id
     */
    void updateById(Integer id);

    /**
     * 4.后台取消预约
     *
     * @param id
     */
    void deleteById(Integer id);
    List<Map<String,Object>> findByMemberId(Integer id);
}
